# Agera2 PAI Library Package - URL-based download similar to broncos
LIBSAI_AGERA2_VERSION = 3.14.0-1
LIBSAI_AGERA2_BRANCH_NAME = REL_3.14

LIBSAI_AGERA2_URL_PREFIX = "https://packages.trafficmanager.net/public/sai/bcmpai/$(LIBSAI_AGERA2_BRANCH_NAME)/$(LIBSAI_AGERA2_VERSION)"

# Runtime package`
LIBSAI_AGERA2 = libsaiagera2_$(LIBSAI_AGERA2_VERSION)_amd64.deb
$(LIBSAI_AGERA2)_URL = "$(LIBSAI_AGERA2_URL_PREFIX)/$(LIBSAI_AGERA2)"

ifneq ($($(LIBSAI_AGERA2)_URL),)

DOCKER_GBSYNCD_AGERA2_STEM = docker-gbsyncd-agera2
DOCKER_GBSYNCD_AGERA2 = $(DOCKER_GBSYNCD_AGERA2_STEM).gz
DOCKER_GBSYNCD_AGERA2_DBG = $(DOCKER_GBSYNCD_AGERA2_STEM)-$(DBG_IMAGE_MARK).gz

$(DOCKER_GBSYNCD_AGERA2)_FILES += $(DSSERVE)

$(DOCKER_GBSYNCD_AGERA2)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BOOKWORM)

$(DOCKER_GBSYNCD_AGERA2)_DBG_DEPENDS += $($(DOCKER_CONFIG_ENGINE_BOOKWORM)_DBG_DEPENDS)

$(DOCKER_GBSYNCD_AGERA2)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BOOKWORM)_DBG_IMAGE_PACKAGES)

SONIC_DOCKER_IMAGES += $(DOCKER_GBSYNCD_AGERA2)
SONIC_BOOKWORM_DOCKERS += $(DOCKER_GBSYNCD_AGERA2)
SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_GBSYNCD_AGERA2)

SONIC_DOCKER_DBG_IMAGES += $(DOCKER_GBSYNCD_AGERA2_DBG)
SONIC_BOOKWORM_DBG_DOCKERS += $(DOCKER_GBSYNCD_AGERA2_DBG)
SONIC_INSTALL_DOCKER_DBG_IMAGES += $(DOCKER_GBSYNCD_AGERA2_DBG)

$(DOCKER_GBSYNCD_AGERA2)_CONTAINER_NAME = gbsyncd
$(DOCKER_GBSYNCD_AGERA2)_RUN_OPT += --privileged -t
$(DOCKER_GBSYNCD_AGERA2)_RUN_OPT += -v /host/machine.conf:/etc/machine.conf
$(DOCKER_GBSYNCD_AGERA2)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro
$(DOCKER_GBSYNCD_AGERA2)_RUN_OPT += -v /host/warmboot:/var/warmboot

# Add runtime package to online debs
SONIC_ONLINE_DEBS += $(LIBSAI_AGERA2)

$(DOCKER_GBSYNCD_AGERA2)_VERSION = 1.0.0
$(DOCKER_GBSYNCD_AGERA2)_PACKAGE_NAME = gbsyncd-agera2
$(DOCKER_GBSYNCD_AGERA2)_PATH = $(PLATFORM_PATH)/../components/docker-gbsyncd-agera2
$(DOCKER_GBSYNCD_AGERA2)_DEPENDS += $(SYNCD) $(LIBSAI_AGERA2)

endif
